import store from '@/store'

export default {
  install(Vue) {
    Vue.directive('allow', {
      inserted(el, binding) {
        if (!store.state.user.info.roles.points.includes(binding.value)) {
          el.parentNode.removeChild(el)
        }
      }
    })
  }
}
